extends Area2D

@onready var timer = $Timer

func _on_body_entered(body: Node2D) -> void:
	print('you died')
	Engine.time_scale = 0.5 # 死亡时全局时间尺度变慢一些
	body.get_node('CollisionShape2D').queue_free() # 使其player上的碰撞节点消失
	timer.start()



func _on_timer_timeout() -> void:
	Engine.time_scale = 1
	get_tree().reload_current_scene()
